﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Simply.Master" AutoEventWireup="true"
    CodeBehind="LabelAdd.aspx.cs" Inherits="TaobaoERP.Views.Product.LabelAdd" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeaderPlaceHolder" runat="server">
    <script src="/Scripts/jquery.validate.js" type="text/javascript"></script>

    <script type="text/javascript">
        $(document).ready(function() {
            $("#form_addLabel").validate({
                rules: {
                    Name: {
                        required: true,
                        remote: '/Product/IsLabel/<%=ViewData["UpdateUrl"]  %>?flag=' + Math.round(Math.random() * 10000)
                    }
                },
                messages: {
                    Name: {
                        required: "不能为空",
                        remote: "已存在此分类"
                    }
                }
            });
        });
    </script>
 
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <%using (Html.BeginForm("LabelAdd", "Product", FormMethod.Post, new { @id = "form_addLabel" }))
      {%>
    <table width="90%" cellspacing="0" cellpadding="0" border="0">
        <tr>
            <th>
                新分类名称 <%=Html.Hidden("ID") %>
            </th>
            <td>
                <%=Html.TextBox("Name")%>
            </td>
        </tr>
        <tr>
            <th>
                排序
            </th>
            <td>
                <input type="text" name="v" />
            </td>
        </tr>
        <tr>
            <td colspan="2" style="text-align: center">
                <input type="submit" name="bt" value="<%=ViewData["buttonValue"] %>"/>
            </td>
        </tr>
    </table>
    <%} %>
</asp:Content>
